<template>
	<view class="order-detail">
		<y-cubar :isFixed="true" :title="info.statusName" :bgColor="`rgba(255,255,255,${opacity})`" />
		<view class="order-detail-bg"></view>
		<view class="con">
			<view class="status">
				<template v-if="userType === 'user'">
					<template v-if="info.status === 'UNPAID'">
						<text>等待支付，还剩</text>
						<uv-count-down ref="countDown" :time="countTime" :autoStart="false" @change="timeChange">
							<view class="time">
								<text class="time__item" v-if="timeData.days > 0">{{ timeData.days }}天</text>
								<text class="time__item"
									v-if="timeData.days > 0 || timeData.hours > 0">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}:</text>
								<text
									class="time__item">{{ timeData.minutes > 10 ?timeData.minutes:'0'+timeData.minutes  }}:</text>
								<text
									class="time__item">{{ timeData.seconds > 10 ?timeData.seconds:'0'+timeData.seconds }}</text>
							</view>
						</uv-count-down>
					</template>
					<text v-else-if="info.status === 'CONFIRM'">
						商家确认中，请耐心等待~
					</text>
					<text v-else-if="info.status === 'UNDERWAY'">
						订单进行中，使用愉快~
					</text>
					<text v-else-if="info.status === 'DEPOSIT_REFUND'">
						商家处理中，请耐心等待~
					</text>
					<text v-else-if="info.status === 'CONFIRM_DEPOSIT_REFUND'">
						商家以退款，请尽快处理~
					</text>
					<text v-else-if="info.status === 'APPEAL'">
						平台处理中，请耐心等待~
					</text>
					<text v-else-if="info.status === 'DISPOSE_APPEAL'">
						平台已处理，请尽快确认
					</text>
					<text v-else-if="info.status === 'FINISH'">
						订单已完成
					</text>
				</template>
				<template v-else>
					<text v-if="info.status === 'CONFIRM'">
						用户已下单，请尽快确认~
					</text>
					<text v-else-if="info.status === 'UNDERWAY'">
						订单进行中，可查看租期进度~
					</text>
					<text v-else-if="info.status === 'DEPOSIT_REFUND'">
						订单已完成，若无损坏请退用户押金~
					</text>
					<text v-else-if="info.status === 'CONFIRM_DEPOSIT_REFUND'">
						用户处理中，请耐心等待~
					</text>
					<text v-else-if="info.status === 'APPEAL'">
						平台处理中，请耐心等待~
					</text>
					<text v-else-if="info.status === 'DISPOSE_APPEAL'">
						平台已处理,等待客户确认
					</text>
					<text v-else-if="info.status === 'FINISH'">
						订单已完成
					</text>
				</template>
			</view>
			<view class="card">
				<view class="title">车辆信息</view>
				<view class="car-info">
					<image :src="info.coverPlan" mode="aspectFill"></image>
					<view class="info">
						<view class="name">{{ info.productName }} </view>
						<view class="desc">
							<text>{{ info.brand }}</text>
							<text>{{ info.model }}</text>
						</view>
						<view class="tags">
							<view class="tag" v-if="info.powerType">{{ info.powerType }}</view>
							<view class="tag" v-if="info.mileage">{{ info.mileage }}</view>
							<view class="tag" v-if="info.fineness">{{ info.fineness }}</view>
							<view class="tag" v-if="info.chargingMode">{{ info.chargingMode }}</view>
						</view>
					</view>
				</view>
				<view class="grid">
					<view class="grid-item">
						<view class="value">
							<text>{{ info.schemes.lease }}</text>
							<text>个月</text>
						</view>
						<view class="label">期数</view>
					</view>
					<view class="grid-item">
						<view class="value">
							<text>{{ info.schemes.rent }}</text>
							<text>元/月</text>
						</view>
						<view class="label">价格</view>
					</view>
					<view class="grid-item">
						<view class="value">
							<text>{{ info.schemes.deposit }}</text>
							<text>元</text>
						</view>
						<view class="label">押金(可退)</view>
					</view>
				</view>
			</view>
			<view class="card" v-if="userType === 'user'">
				<view class="title">商家信息</view>
				<view class="enum">
					<view class="cell">
						<view class="label">商家类型</view>
						<view class="value type">
							<text v-if="info.productType === 'PROPRIETARY'">平台自营</text>
							<text v-else>车商</text>
						</view>
					</view>
					<view class="cell">
						<view class="label">商家名称</view>
						<view class="value">{{ info.merchantName }}</view>
					</view>
					<view class="cell">
						<view class="label">联系人</view>
						<view class="value">{{ info.merchantRelationName }}</view>
					</view>
					<view class="cell">
						<view class="label">联系电话</view>
						<view class="value">{{ info.merchantPhone }}</view>
					</view>
				</view>
			</view>
			<view class="card">
				<view class="title">租赁人信息</view>
				<view class="enum">
					<view class="cell">
						<view class="label">联系人</view>
						<view class="value">{{ info.budgetName }}</view>
					</view>
					<view class="cell">
						<view class="label">联系电话</view>
						<view class="value">{{ info.cellphone }}</view>
					</view>
					<view class="cell">
						<view class="label">地址</view>
						<view class="value">{{ info.lesseesAddress }}</view>
					</view>
					<view class="cell">
						<view class="label">身份证号</view>
						<view class="value">{{ info.identityNo }}</view>
					</view>
					<view class="cell">
						<view class="label">身份证照片</view>
						<view class="value ht" @click="handPriveIdCard">查看</view>
					</view>
					<view class="cell">
						<view class="label">驾照</view>
						<view class="value ht" @click="handPrivelicence">查看</view>
					</view>
					<view class="cell" @click.stop="handPriveht()">
						<view class="label">合同</view>
						<view class="value ht">查看</view>
					</view>
				</view>
			</view>
			<view class="card">
				<view class="title">紧急联系人信息</view>
				<view class="enum">
					<view class="cell">
						<view class="label">联系人</view>
						<view class="value">{{ info.emergencyName }}</view>
					</view>
					<view class="cell">
						<view class="label">手机号</view>
						<view class="value">{{ info.emergencyPhone }}</view>
					</view>
					<view class="cell">
						<view class="label">关系</view>
						<view class="value">{{ info.emergencyRelation }}</view>
					</view>
				</view>
			</view>
			<view class="card" v-if="logList.length > 0">
				<view class="title">分期信息</view>
				<view class="fenqi">
					<view class="fenqi-item" v-for="(item, index) in logList" :key="index">
						<view class="top">
							<text> {{ item.leaseName }}</text>
							<text>{{ item.refundMoney }}元</text>
						</view>
						<view class="bottom">
							<text>{{ item.refundTime }}</text>
							<text
								:style="{ color: item.status === 'PAID' ? '#27C485':'#999999'}">{{ item.status === 'PAID' ? '已支付' : '未支付' }}</text>
						</view>
					</view>
				</view>
			</view>
			<view class="card">
				<view class="title">订单信息</view>
				<view class="enum">
					<view class="cell">
						<view class="label">订单编号</view>
						<view class="value">{{ info.orderNo }}</view>
					</view>
					<view class="cell">
						<view class="label">提取服务</view>
						<view class="value">
							<text v-if="info.type === 'EXTRACT'">自提</text>
							<text v-else>送货上门</text>
						</view>
					</view>
					<view class="cell">
						<view class="label">{{ info.type === 'EXTRACT' ? '自提地址' : '送货上门地址' }}</view>
						<view class="value">
							<text v-if="info.type === 'EXTRACT'">
								{{ info.merchantProvince }}{{ info.merchantCity }}{{ info.merchantAddress }}
							</text>
							<text v-else>
								{{ info.provinceName }}{{ info.cityName }}{{ info.address }}
							</text>
						</view>
					</view>
					<template v-if="info.type === 'SEND'">
						<view class="cell">
							<view class="label">联系人姓名</view>
							<view class="value">
								<text>{{ info.name }}</text>
							</view>
						</view>
						<view class="cell">
							<view class="label">联系电话</view>
							<view class="value">
								<text>{{ info.phone }}</text>
							</view>
						</view>
					</template>
					<template v-else>
						<view class="cell">
							<view class="label">联系人姓名</view>
							<view class="value">
								<text>{{ info.merchantRelationName }}</text>
							</view>
						</view>
						<view class="cell">
							<view class="label">联系电话</view>
							<view class="value">
								<text>{{ info.merchantPhone }}</text>
							</view>
						</view>
					</template>

					<view class="cell">
						<view class="label">下单时间</view>
						<view class="value">{{ info.createTime }}</view>
					</view>
					<view class="cell" v-if="info.endTime">
						<view class="label">到期时间</view>
						<view class="value">{{ info.endTime }}</view>
					</view>
				</view>
			</view>
			<view class="card" v-if="['CONFIRM_DEPOSIT_REFUND', 'APPEAL', 'DISPOSE_APPEAL'].includes(info.status)">
				<view class="title">押金信息</view>
				<view class="enum">
					<view class="cell">
						<view class="label">扣除押金金额</view>
						<view class="value">¥{{ info.deductDeposit }}</view>
					</view>
					<view class="cell">
						<view class="label">退还押金金额</view>
						<view class="value">¥{{ info.returnDeposit }}</view>
					</view>
					<view class="cell">
						<view class="label">扣除项</view>
						<view class="value">{{ info.deductReason }}</view>
					</view>
					<view class="cell">
						<view class="label">扣除项凭证</view>
						<view class="img">
							<template v-if="info.deductVoucher.length > 0">
								<image :src="info.deductVoucher[0]" mode="aspectFill" @click="handPrive"
									style="border-radius: 20rpx;"></image>
							</template>
						</view>
					</view>
					<view class="cell">
						<view class="label">退款时间</view>
						<view class="value">{{ info.returnTime }}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="action-bottom"
			v-if="(!['DEPOSIT_REFUND', 'FINISH'].includes(info.status) || userType !== 'user') && (!['APPEAL', 'CONFIRM_DEPOSIT_REFUND', 'DISPOSE_APPEAL', 'FINISH'].includes(info.status) || userType !== 'shop')">
			<template v-if="info.status === 'UNPAID'">
				<button class="cu-btn" @click="handCancelPay">取消订单</button>
				<template v-if="userType === 'user'">
					<button class="cu-btn cu-btn-a" @click.stop="handPay()">立即支付</button>
				</template>
			</template>
			<template v-if="info.status === 'CONFIRM'">
				<template v-if="userType === 'user'">
					<button class="cu-btn" @click="handCancel">取消订单</button>
					<button class="cu-btn cu-btn-a" @click.stop="handPhone()">联系商家</button>
				</template>
				<template v-else>
					<button class="cu-btn" @click="orderConfim">确认</button>
					<button class="cu-btn cu-btn-a" @click.stop="handPhone()">联系客户</button>
				</template>
			</template>
			<template v-if="info.status === 'UNDERWAY'">
				<view class="flex-sub flex align-center justify-between">
					<view class="tip">
						<text
							v-if="info.leaseOrder">{{ info.leaseOrder.leaseName }}分期账单于{{ info.leaseOrder.refundTime }}还</text>
					</view>
					<template v-if="userType === 'user'">
						<button v-if="info.isLease" class="cu-btn cu-btn-a" @click.stop="handLease()">续租</button>
						<button v-if="info.productType === 'DEALER'" class="cu-btn cu-btn-a"
							@click.stop="handBill()">查看账单</button>
					</template>
				</view>
			</template>
			<template v-if="info.status === 'DEPOSIT_REFUND' && userType === 'shop'">
				<button class="cu-btn cu-btn-a" @click.stop="handTui()">退押金</button>
			</template>
			<template v-else-if="info.status === 'CONFIRM_DEPOSIT_REFUND' && userType === 'user'">
				<button class="cu-btn" @click="handAppeal">申诉</button>
				<button class="cu-btn cu-btn-a" @click="handOver">确认完成</button>
			</template>
			<template v-else-if="info.status === 'APPEAL' && userType === 'user'">
				<button class="cu-btn" @click="handCancelAppeal">取消申诉</button>
			</template>
			<template v-else-if="info.status === 'DISPOSE_APPEAL' && userType === 'user'">
				<button class="cu-btn cu-btn-a" @click="handOver">确认完成</button>
			</template>
		</view>
		<diao-pop ref="diaoRef" :title="title" :tip="tip" :confirmText="confirmText" @confirm="handConfirm" />
		<bill-pop ref="billRef" @paySuccess="init(info.id)" />
		<tui-dia ref="tuiRef" @success="init(info.id)" />
		<uv-modal ref="modal" show-cancel-button confirm-color="#FF9113" @confirm="handConfirm" width="550rpx">
			<view style="line-height: 100rpx;">{{ tip }}</view>
		</uv-modal>
	</view>
</template>

<script setup>
	import {
		ref,
		getCurrentInstance
	} from 'vue'
	import {
		onLoad,
		onUnload,
		onPageScroll
	} from "@dcloudio/uni-app";
	import YCubar from '@/components/y-cubar/index.vue'
	import BillPop from '@/components/BillPop.vue'
	import tuiDia from '../dealers/components/tuiDia.vue'
	import DiaoPop from '@/components/DiaoPop.vue'
	import {
		doDetail,
		doLogList,
		doCancel,
		doCancelApp,
		doOver,
		doLease,
		doCancelPay,
		doOrderPay
	} from '@/apis/order.js'
	import {
		getCapital
	} from '@/utils'
	import {
		getDate,
		timeIncludes
	} from '@/utils/index.js'
	import {
		doConfirm
	} from '@/apis/shopOrder.js'

	const timeSplit = (e) => {
		let times = ['', '', '']
		if (e) {
			const time = e.split(' ')
			times = time[0].split('-')
		}
		return times
	}

	const handPriveht = () => {
		const newInfo = uni.$uv.deepClone(info)
		const starTime = timeSplit(newInfo.value.startTime)
		const endTime = timeSplit(newInfo.value.endTime)
		const qianTime = timeSplit(newInfo.value.createTime)
		let htInfo = {}
		if (newInfo.value.productType === 'DEALER') {
			htInfo = {
				orderId: newInfo.value.id,
				jia: newInfo.value.merchantRelationName,
				orderNo: '',
				jiaName: newInfo.value.merchantName,
				jiaPhone: newInfo.value.merchantPhone,
				yiName: newInfo.value.budgetName,
				yiPhone: newInfo.value.cellphone,
				city: newInfo.value.merchantCity,
				jjName: newInfo.value.emergencyName,
				jjPhone: newInfo.value.emergencyPhone,
				jjAbout: newInfo.value.emergencyRelation,
				starYear: starTime[0],
				starMonth: starTime[1],
				starDay: starTime[2],
				endYear: endTime[0],
				endMonth: endTime[1],
				endDay: endTime[2],
				jiaYear: qianTime[0],
				jiaMonth: qianTime[1],
				jiaDay: qianTime[2],
				yiYear: qianTime[0],
				yiMonth: qianTime[1],
				yiDay: qianTime[2],
				jiaqianImg: newInfo.value.merchantName,
				qianImg: newInfo.value.contract,
				price: newInfo.value.schemes.rent,
				priceDx: getCapital(newInfo.value.schemes.rent),
				bzj: newInfo.value.schemes.deposit,
				bzjDx: getCapital(newInfo.value.schemes.deposit),
				qi: newInfo.value.schemes.lease,
				cjh: '',
				fdjh: '',
				pzh: '',
				contractSeal: '',
				contractSeal: newInfo.value.contractSeal,
			}
		} else {
			htInfo = {
				orderId: newInfo.value.id,
				orderNo: newInfo.value.orderNo,
				jianame: newInfo.value.merchantName,
				jiaAddress: `${newInfo.value.merchantProvince}${newInfo.value.merchantCity}${newInfo.value.merchantAddress}`,
				jiaZz: newInfo.value.licenseNo,
				jiaPhone: newInfo.value.merchantPhone,
				yiName: newInfo.value.budgetName,
				yiAddress: newInfo.value.lesseesAddress,
				yiCardNo: newInfo.value.identityNo,
				yiPhone: newInfo.value.cellphone,
				city: newInfo.value.merchantCity,
				jjName: newInfo.value.emergencyName,
				jjPhone: newInfo.value.emergencyPhone,
				jjAbout: newInfo.value.emergencyRelation,
				starYear: starTime[0],
				starMonth: starTime[1],
				starDay: starTime[2],
				endYear: endTime[0],
				endMonth: endTime[1],
				endDay: endTime[2],
				jiaYear: qianTime[0],
				jiaMonth: qianTime[1],
				jiaDay: qianTime[2],
				yiYear: qianTime[0],
				yiMonth: qianTime[1],
				yiDay: qianTime[2],
				qianImg: newInfo.value.contract,
				price: newInfo.value.schemes.rent,
				priceDx: getCapital(newInfo.value.schemes.rent),
				bzj: newInfo.value.schemes.deposit,
				bzjDx: getCapital(newInfo.value.schemes.deposit),
				qi: newInfo.value.schemes.lease,
				contractSeal: newInfo.value.contractSeal,
			}
		}

		uni.navigateTo({
			url: '/pagesA/car/contract?type=prive',
			success: (res) => {
				res.eventChannel.emit('acceptDataFromOpenerPage', htInfo)
			}
		})
	}

	const handPriveIdCard = () => {
		uni.previewImage({
			urls: [info.value.identityCardFront, info.value.identityCardTail]
		})
	}

	const handPrivelicence = () => {
		uni.previewImage({
			urls: [info.value.licence]
		})
	}

	const handAppeal = () => {
		uni.navigateTo({
			url: `/pagesA/order/appeal?id=${info.value.id}`,
			events: {
				successEvent: () => {
					init(info.value.id)
				}
			}
		})
	}

	const billRef = ref()
	const handBill = () => {
		billRef.value.handOpen(info.value)
	}

	const tuiRef = ref()
	const handTui = () => {
		tuiRef.value.handOpen(info.value)
	}

	const handPrive = () => {
		uni.previewImage({
			urls: info.value.deductVoucher
		})
	}

	const {
		proxy
	} = getCurrentInstance();

	let type = 'cancel'
	const modal = ref()
	const tip = ref('')
	const diaoRef = ref()
	const title = ref('')
	const confirmText = ref('')
	const handCancel = () => {
		type = 'cancel'
		tip.value = '确认要取消订单吗?'
		modal.value.open()
	}
	const handCancelPay = () => {
		type = 'cancelPay'
		tip.value = '确认要取消订单吗?'
		modal.value.open()
	}
	const handPay = async () => {
		const {
			code,
			message
		} = await doOrderPay(info.value.id)
		if (code !== 200) {
			uni.hideLoading()
			uni.$uv.toast(message)
			return
		}
		wxPay(JSON.parse(message))
	}
	const wxPay = (payInfo) => {
		uni.hideLoading()
		const orderInfo = {
			provider: 'wxpay', // 服务提提供商
			timeStamp: payInfo.timeStamp, // 时间戳
			nonceStr: payInfo.nonceStr, // 随机字符串
			package: payInfo.package,
			signType: payInfo.signType, // 签名算法
			paySign: payInfo.paySign, // 签名
		};
		uni.requestPayment({
			provider: 'wxpay',
			...orderInfo,
			success: (res) => {
				uni.$uv.toast('支付成功')
				init(info.value.id)
			},
			fail: (err) => {
				uni.$uv.toast('支付失败')
			}
		});
	}
	const handCancelAppeal = () => {
		type = 'app'
		tip.value = '确认要取消申述吗?'
		modal.value.open()
	}
	const handOver = () => {
		type = 'over'
		title.value = '确定完成吗?'
		tip.value = '请仔细查看退回押金信息\n确认后将无法撤回'
		confirmText.value = '确认'
		diaoRef.value.open()
	}
	const handLease = () => {
		type = 'lease'
		title.value = '续租提示'
		tip.value = '您的租车方案即将到期\n是否要续期？'
		confirmText.value = '续租'
		diaoRef.value.open()
	}
	const orderConfim = () => {
		type = 'confirm'
		tip.value = '确认要确认订单吗?'
		modal.value.open()
	}
	const handConfirm = async () => {
		if (type === 'cancel') {
			await doCancel(info.value.id)
			init(info.value.id)
		} else if (type === 'cancelPay') {
			await doCancelPay(info.value.id)
			init(info.value.id)
		} else if (type === 'confirm') {
			await doConfirm(info.value.id)
			init(info.value.id)
		} else if (type === 'app') {
			await doCancelApp(info.value.id)
			init(info.value.id)
		} else if (type === 'over') {
			await doOver(info.value.id)
			init(info.value.id)
		} else if (type === 'lease') {
			await doLease(info.value.id)
			uni.$uv.toast('续租成功')
			init(info.value.id)
		}
	}

	const handPhone = () => {
		uni.makePhoneCall({
			phoneNumber: userType.value === 'user' ? info.value.phone : info.value.merchantPhone
		})
	}

	const info = ref({
		schemes: {},
		deductVoucher: []
	})
	const countDown = ref()
	const countTime = ref(0)
	const timeData = ref({})
	const timeChange = (e) => {
		timeData.value = e
	}
	const logList = ref([])
	const init = async (id) => {
		doLogList(id).then(data => {
			logList.value = data
		})
		doDetail(id).then(data => {
			const statusEnum = {
				CANCEL: '已取消',
				CONFIRM: '待确认',
				UNDERWAY: '进行中',
				DEPOSIT_REFUND: '退还中',
				CONFIRM_DEPOSIT_REFUND: '待确认',
				APPEAL: '用户申诉中',
				DISPOSE_APPEAL: '平台已处理',
				FINISH: '已完成',
			}
			if (data.schemes) {
				data.schemes = JSON.parse(data.schemes)
			} else {
				data.schemes = []
			}
			data.statusName = statusEnum[data.status]
			if (data.deductVoucher) {
				data.deductVoucher = data.deductVoucher.split(',')
			} else {
				data.deductVoucher = []
			}
			data.isLease = false
			if (data.status === 'UNDERWAY' && userType.value === 'user') {
				const starTime = new Date(getDate(data.endTime, -10)).getTime()
				const endTIme = new Date(data.endTime.replace(/-/g, '/')).getTime()
				const nowTime = new Date().getTime()
				if (nowTime >= starTime && nowTime <= endTIme) {
					data.isLease = true
				}
			}
			info.value = data
			if (data.status === 'UNPAID') {
				const cancelTime = new Date(data.cancelTime.replace(/-/g, '/')).getTime()
				const nowTIme = new Date().getTime()
				countTime.value = (cancelTime - nowTIme)
				countDown.value.start()
			}
		})
	}

	const userType = ref('user')
	onLoad((e) => {
		userType.value = e?.type || 'user'
		init(e.id)
	})

	onUnload(() => {
		const eventChannel = proxy.getOpenerEventChannel()
		eventChannel.emit('backInfo', info.value);
	})

	const opacity = ref(0)
	onPageScroll((e) => {
		const childerOpa = Number((e.scrollTop / 200).toFixed(2))
		opacity.value = childerOpa >= 1 ? 1 : childerOpa
	})
</script>

<style lang="scss" scoped>
	.order-detail {
		min-height: 100vh;
		background-color: #F5F5F5;
		padding-bottom: 150rpx;
		padding-bottom: calc(constant(safe-area-inset-bottom) + 150rpx);
		padding-bottom: calc(env(safe-area-inset-bottom) + 150rpx);

		&-bg {
			width: 750rpx;
			height: 408rpx;
			background: linear-gradient(180deg, #F7C241 0%, #F5F5F5 100%);
			position: absolute;
			top: 0;
		}

		.con {
			position: relative;
			z-index: 3;
			padding: 24rpx;

			.status {
				text-align: center;
				font-size: 30rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #333333;

				.time {
					margin-top: 10rpx;
					font-weight: bold;
					color: orangered;
				}
			}
		}

		.card {
			width: 702rpx;
			margin: 30rpx auto 0 auto;
			box-sizing: border-box;
			background-color: #fff;
			border-radius: 16rpx;
			padding: 24rpx;

			.title {
				font-size: 32rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #333333;
			}

			.car-info {
				margin-top: 24rpx;
				display: flex;
				align-items: center;

				image {
					width: 160rpx;
					height: 160rpx;
					border-radius: 16rpx;
				}

				.info {
					flex: 1;
					margin-left: 24rpx;

					.name {
						font-size: 30rpx;
						font-family: PingFang SC-Bold, PingFang SC;
						font-weight: bold;
						color: #333333;
					}

					.desc {
						margin-top: 8rpx;
						font-size: 24rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;
					}

					.tags {
						margin-top: 14rpx;
						display: flex;

						.tag {
							font-size: 24rpx;
							font-family: PingFang SC-Regular, PingFang SC;
							font-weight: 400;
							color: #999999;
							padding: 6rpx 12rpx;
							background: #F5F5F5;
							border-radius: 4rpx;

							&:not(:first-child) {
								margin-left: 8rpx;
							}
						}
					}
				}
			}

			.grid {
				margin-top: 32rpx;
				background: #F8F8F8;
				border-radius: 16rpx;
				padding: 32rpx 40rpx;
				display: flex;
				justify-content: space-between;

				&-item {
					.value {
						text {
							font-size: 24rpx;
							font-family: PingFang SC-Regular, PingFang SC;
							font-weight: 400;
							color: #FF4E00;

							&:first-child {
								font-size: 32rpx;
							}
						}
					}

					.label {
						margin-top: 10rpx;
						font-size: 26rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #666666;
					}
				}
			}

			.enum {
				margin-top: 24rpx;

				.cell {
					display: flex;
					justify-content: space-between;

					&:not(:first-child) {
						margin-top: 32rpx;
					}

					.label {
						font-size: 30rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;
					}

					.value {
						flex: 1;
						margin-left: 40rpx;
						font-size: 30rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #333333;
						text-align: right;
					}

					.img {
						image {
							width: 144rpx;
							height: 144rpx;
						}
					}

					.type {
						color: #F57B01;
					}

					.ht {
						color: #2758E7;
					}
				}
			}

			.fenqi {
				&-item {
					padding: 26rpx;
					border-bottom: 1rpx solid #eee;

					.top {
						display: flex;
						align-items: center;
						justify-content: space-between;
						font-size: 28rpx;
						font-family: PingFang SC-Medium, PingFang SC;
						font-weight: 500;
						color: #333333;
					}

					.bottom {
						margin-top: 8rpx;
						display: flex;
						align-items: center;
						justify-content: space-between;

						text {
							color: #999999;

							&:last-child {
								color: #27C485;
							}
						}
					}
				}
			}
		}

		.action-bottom {
			position: fixed;
			bottom: 0;
			z-index: 3;
			width: 750rpx;
			background-color: #fff;
			padding: 18rpx 24rpx;
			box-shadow: 0rpx -2rpx 12rpx 2rpx rgba(0, 0, 0, 0.03);
			padding-bottom: 18rpx;
			padding-bottom: calc(constant(safe-area-inset-bottom) + 18rpx);
			padding-bottom: calc(env(safe-area-inset-bottom) + 18rpx);
			display: flex;
			justify-content: flex-end;

			.tip {
				flex: 1;
				margin-right: 20rpx;
				font-size: 26rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #F57B01;
			}

			.cu-btn {
				width: 192rpx;
				height: 74rpx;
				background: #F5F5F5;
				border-radius: 16rpx;
				font-size: 30rpx;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
				color: #333333;
				margin: 0;

				&:not(:last-child) {
					margin-right: 20rpx;
				}

				&-a {
					background: #FFC434;
					color: #333333;
				}
			}
		}
	}
</style>